---@class IDataItem : LuaObject
---@field protected super IDataItem
IDataItem = BaseClass("IDataItem")

function IDataItem:__ctor()
    self.Id = 0;    --唯一ID
end

---@param reader ExcelLineReader
function IDataItem:Load(reader)
    self.temp = reader:ReadShortString()
    self.Id = tonumber(self.temp)
    self.temp = nil
end

---@class IDataMgr : LuaObject
---@field protected super IDataMgr
local this = BaseClass("IDataMgr")

function this:__ctor()
    self.mDataCount = 0
    self.mItemDic = {}
    self.mItemList = {}
end

function this:GetItemByKey(key)
    local idx = self:GetIdxByKey(key)
    return self:GetItemByIdx(idx)
end

function this:GetItemByIdx(idx)
    return self.mItemList[idx]
end

function this:GetIdxByKey(key)
    return self.mItemDic[key]
end

------@return string
function this:FileName()
    return "Txt/"
end

---@param reader ExcelLineReader
function this:Load(reader)

end

function this:Init()
    self.mDataCount = 0
    local reader = ExcelReader.New()
    if (not reader:LoadFile(self:FileName())) then
        reader:Clear(); return
    end

    local lineReader = reader:ReadLine()
    while lineReader do
        self:Load(lineReader)
        self.mDataCount = self.mDataCount + 1
        lineReader = reader:ReadLine()
    end
    reader:Clear()
end

IDataMgr = this